﻿package com.moonshineproject.text.change 
{
	
	public class TextChangeMulti extends TextChangeBase
	{
		private var _changes:Vector.<TextChangeBase>;
		
		public function get changes():Vector.<TextChangeBase>	{ return _changes; }
		
		public function TextChangeMulti(... changes)
		{
			super(TextChangeBase.UNBLOCK);
			
			if (changes[0] is Vector.<TextChangeBase>)
			{
				_changes = Vector.<TextChangeBase>(changes[0]);
			}
			else
			{
				_changes = Vector.<TextChangeBase>(changes);
			}
		}
		
		public override function getReverse():TextChangeBase
		{
			var revChanges:Vector.<TextChangeBase> = new Vector.<TextChangeBase>();
			
			for (var i:int = changes.length; i--; )
			{
				revChanges.push(changes[i].getReverse());
			}
			
			return new TextChangeMulti(revChanges);
		}
		
	}

}